﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.Composition;

using org.theGecko.Utilities.MefMvc;

using LeMigue.TeamPortal.Base.Mvc;
using LeMigue.TeamPortal.Base.View;
using LeMigue.Scrum.Iterface.Service;
using LeMigue.Scrum.TfsScrumV1.Service;
using LeMigue.TeamPortal.Base.Biz.Interface;
using LeMigue.TeamPortal.Base.Biz.Implement;
using LeMigue.TeamPortal.Base.Biz;


namespace LeMigue.TeamPortal.Projetos.Controllers
{
    [ControllerMetaData("Projetos")]
    [Export(typeof(IController)), PartCreationPolicy(CreationPolicy.NonShared)]
    [Authorize]
    [CheckTeam]
    public class ProjetosController : TeamPortalController
    {
        private IProjectBiz ProjectBiz = FactoryBiz.ProjectBiz;

        public ActionResult Index()
        {
            return View();
        }

        [ContainerHome("Projetos", 2)]
        public PartialViewResult HomeBox()
        {
            return PartialView();
        }

        [ChildActionOnly]
        public PartialViewResult TreeProject()
        {
            IList<ProjectView> projetos = ProjectBiz.List(Team);

            if (projetos.Count > 0)
                return PartialView(projetos);

            return PartialView("NoProject");
        }

    }
}
